package basic.io;

import java.io.IOException;
import java.io.Reader;

public class MyBufferedReader {
	
	private Reader reader;
	
	public MyBufferedReader(Reader reader) {
		super();
		this.reader = reader;
	}

	public Reader getReader() {
		return reader;
	}

	public void setReader(Reader reader) {
		this.reader = reader;
	}
	
	public String readLine() throws IOException{
		StringBuilder sBuilder = new StringBuilder();
		
		int len=0;
    	 while((len=reader.read())!=-1){
    		
    		 if(len=='\r'){
    			 continue;
    		 }
    		 if(len=='\n'){
    			 return sBuilder.toString();
    		 }
    		 sBuilder.append((char)len);
    		 
    	 }	
		return null;
	}
	
	

}
